#include "imageprovider.h"
#include <QDebug>

ImageProvider::ImageProvider():
    QQuickImageProvider(QQuickImageProvider::Pixmap)
{}

ImageProvider &ImageProvider::instance()
{
    static ImageProvider inst;

    return inst;
}

QPixmap ImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
{
    return img_;
}

void ImageProvider::insertPixmap(QPixmap &&pixmap)
{
    img_ = std::move(pixmap);
}

QImage ImageProvider::getImage()
{
    return img_.toImage();
}
